package com.lcredu.lcrliving.commodity.controller;

import com.lcredu.common.util.PageUtils;
import com.lcredu.lcrliving.commodity.entity.SkuInfoEntity;
import com.lcredu.lcrliving.commodity.service.SkuInfoService;
import com.lcredu.lcrliving.commodity.vo.SearchResult;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author kirito
 * @create 2023-12-13 8:40
 */
@Controller
public class SearchController {
    //装配skuInfoService
    @Resource
    private SkuInfoService skuInfoService;

    /**
     * 检索页
     * 用户提交的数据返回到Map
     *
     * @return
     */
    @RequestMapping("/list.html")
    public String Search(@RequestParam Map<String, Object> params, Model model) {
        SearchResult searchResult = skuInfoService.querySearchPageByCondition(params);//->searchResult



        //数据给thy使用
        model.addAttribute("result", searchResult);
        return "list";
    }
}
